  var editor = CodeMirror.fromTextArea(document.getElementById("code"),
    {
      lineNumbers: true,
      matchBrackets: true,
      theme: "eclipse"
    });

function selectLanguage(node) {
    var language = node.options[node.selectedIndex].innerHTML;
    if (language=="C") 
      {
        editor.setOption("mode", "text/x-csrc");
      }
    else if (language=="C++") 
      {
        editor.setOption("mode","text/x-c++src");
      }
    else if (language=="Java") 
      {
        editor.setOption("mode","text/x-java");
      }
    else if (language=="Pascal") 
      {
        editor.setOption("mode", "text/x-pascal");
      }
    else if (language=="Python") 
      {
        editor.setOption("mode", {name: "python",version: 2,singleLineStringErrors: false});
        editor.setOption("lineNumbers", true);
        editor.setOption("tabMode", "shift");
        editor.setOption("indentUnit", 4);
      };
  }

  function selectTheme(node)
  {
    var theme = node.options[node.selectedIndex].innerHTML;
    editor.setOption("theme",theme);
  }